<template>
  <div>
    <header>
      <router-link to="/">首页</router-link>
      <router-link to="/news">新闻</router-link>
      <router-link to="/book">图书</router-link>
      <router-link to="/course">课程</router-link>
      <router-link to="/video">视频</router-link>
      <router-link to="/user">用户首页</router-link>
      <router-link to="/login">登录</router-link>

      <button @click="go">前进</button>
      <input type="text" v-model="num">
      <button @click="goto">指定</button>
      <button @click="backto">后退</button>
    </header>
    <article>
      <router-view></router-view>
    </article>
  </div>
</template>

<script>
export default {
  name: 'App',
  data(){
    return {
      num:1
    }
  },
  components: {

  },
  methods:{
    go(){
      this.$router.go(1)
    },
    goto(){
      this.$router.go(this.num)
    },
    backto(){
      this.$router.go(-1)
    },
  }
}

</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

a{padding:10px 20px}

</style>
